package com.blb.thread;


public class Work4 {

    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            for (int i = 1;i <= 100;i++) {
                System.out.println(Thread.currentThread().getName() + "我在送快递" + i);
            }
        });
        thread.setName("快递小哥");
        thread.start();

        Thread beauty = new Thread(() -> {
            for (int i = 1; i <= 88; i++) {
                if(i == 10){
                    try {
                        thread.join();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println(Thread.currentThread().getName()+"在看狂飙" + i);
            }
        });
        beauty.setName("美女");
        beauty.setPriority(Thread.MAX_PRIORITY);
        beauty.start();
    }
}
